<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<%@ include file="header.jsp"%>
</head>
<body>
	<%-- ${list} --%>
	<a class="btn btn-primary" href="${path}/user_add.jsp">添加</a>
	<table class="table table-striped table-bordered  table-hover">
		<tr>
			<td>ID</td>
			<td>部门名</td>
			<td>名字</td>
			<td>密码</td>
			<td>邮箱</td>
			<td>角色</td>
			<td>删除</td>
		</tr>
		<c:forEach items="${list}" var="user">
			<tr>
				<td>${user.id}</td>
				<td>${user.deptId}</td>
				<td>${user.username}</td>
				<td>${user.password}</td>
				<td>${user.email}</td>
				<td>${user.role}</td>
				<td><a href="javascript:deleteById(${user.id})">删除</a></td>
			</tr>
		</c:forEach>
		
	</table>
	<script>
		function deleteById(id) {
			layer.confirm('您确认要删除么？', function() {
				location.href = '${path}/user?method=deleteById&id=' + id
			})
		}
	</script>
</body>
</html>